package com.ljl.ningwei.controller;


import com.ljl.ningwei.common.result.Result;
import com.ljl.ningwei.common.utils.TimeUtil;
import com.ljl.ningwei.entity.User;
import com.ljl.ningwei.service.UserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户端登录
 */
@RestController
@RequiredArgsConstructor
@Slf4j
public class UserController {

    private final UserService userService;

    /**
     * 登录接口
     */
    @RequestMapping("/console/login")
    public Result<String> login(
            @RequestParam(name = "account") String account,
            @RequestParam(name = "password") String password) {
        return Result.success(userService.login(account,password));
    }
}
